/*----------------------------------------------------------------------------
Owner(s): Shane Whitfield
$Copyright: $
$Id: $
----------------------------------------------------------------------------*/

#include "nncommand.h"
#include <string>

#if DEBUG

/*--------------------------------------------------------------------------*/
CNNCommand::CNNCommand() : super("NNCommand")
{

}
			
void CNNCommand::RegisterCommandTaker(CCommandTaker* i_commandTaker)
{
	m_commandTakers.push_back(i_commandTaker);
}

void CNNCommand::HandleCommand(const char* i_commandTakerName, const char* i_commandFunction, const char* i_parameters)
{	

	//find the mgr
	for(int iCommandTaker = 0; iCommandTaker < m_commandTakers.size(); ++iCommandTaker)
	{
		if (!strcmp(m_commandTakers[iCommandTaker]->GetName(), i_commandTakerName))
		{
			m_commandTakers[iCommandTaker]->On_Command(i_commandFunction, i_parameters);
		}
	}
}

#endif

CCommandTaker::CCommandTaker() 
{
#if DEBUG
	g_nncommand.RegisterCommandTaker(this);
#endif
}



/*-----------------------------------EOF!-----------------------------------*/ 